home *** CD-ROM | disk | FTP | other *** search
Wrap
VERSION 2.00 Begin MDIForm frmMDI Caption = "VT-220 for Workgroups" ClientHeight = 4665 ClientLeft = 1380 ClientTop = 2595 ClientWidth = 8010 Height = 5325 Icon = MAIN.FRX:0000 Left = 1335 LinkTopic = "MDIForm1" Top = 1980 Width = 8100 Begin Menu mnuFile Caption = "&File" Begin Menu mnuFNew Caption = "&New..." End Begin Menu mnuFOpen Caption = "&Open..." End Begin Menu mnuBlank1 Caption = "-" End Begin Menu mnuFExit Caption = "E&xit" End End Begin Menu mnuHelp Caption = "&Help" Begin Menu mnuHContents Caption = "&Contents..." End Begin Menu mnuHAbout Caption = "&About..." End End Declare Function WritePrivateProfileString Lib "Kernel" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lplFileName As String) As Integer Declare Function GetPrivateProfileString Lib "Kernel" (ByVal lpApplicationName As String, lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Integer, ByVal lpFileName As String) As Integer Declare Function GetPrivateProfileInt Lib "Kernel" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal nDefault As Integer, ByVal lpFileName As String) As Integer Sub MDIForm_Load () '********************************************************************************************* '* Variables for messaging - DNW '********************************************************************************************* Const MB_OK = 0, MB_OKCANCEL = 1 ' Define buttons. Const MB_ICONEXCLAMATION = 48, MB_ICONINFORMATION = 64 Const MB_DEFBUTTON2 = 256, IDYES = 6, IDNO = 7 ' Define other. Dim DgDef, msg, Response, title ' Declare variables. Dim intRunningApp% ' Stores true or false depending on whether the app is already running - DNW Dim FNum, FormLeft, FormTop, FormWidth, FormHeight On Error GoTo mdiform_load_error App.HelpFile = "vt220wfg.hlp" ' Application starts here (Load event of Startup form). ' Always set working directory to directory containing the application. ChDir App.Path ' Icon shows us closed Icon = LoadPicture("net09b.ico") 'Initialize document form arrays, and show first document. ReDim Document(1) ReDim FState(1) FState(1).Deleted = True Left = GetPrivateProfileInt(AppName, "Left", 1000, IniFile) Width = GetPrivateProfileInt(AppName, "Width", 10000, IniFile) Top = GetPrivateProfileInt(AppName, "Top", 1000, IniFile) Height = GetPrivateProfileInt(AppName, "Height", 8000, IniFile) Show CenterForm frmMDI, OpenSession OpenSession.Show 1 Exit Sub '********************************************************************************************* '* Error handling routine for the mdi form load '********************************************************************************************* mdiform_load_error: title = "Err" msg = "An error occurred starting. The error is: " & Error(Err) & "." DgDef = MB_OK + MB_ICONEXCLAMATION ' Describe dialog. Response = MsgBox(msg, DgDef, title) ' Get user response. End Sub Sub MDIForm_QueryUnload (Cancel As Integer, UnloadMode As Integer) Unload frmMDI End Sub Sub MDIForm_Unload (Cancel As Integer) success = WritePrivateProfileString(AppName, "Left", Str$(Left), IniFile) success = WritePrivateProfileString(AppName, "Top", Str$(Top), IniFile) success = WritePrivateProfileString(AppName, "Width", Str$(Width), IniFile) success = WritePrivateProfileString(AppName, "Height", Str$(Height), IniFile) Unload ConnectDlg End End Sub Sub mnuFExit_Click () Unload Me End Sub Sub mnuFNew_Click () CenterForm frmMDI, NewSession NewSession.Show 1 End Sub Sub mnuFOpen_Click () CenterForm frmMDI, OpenSession OpenSession.Show 1 End Sub Sub mnuHAbout_Click () frmAbout.Show 1 End Sub Sub mnuHContents_Click () r = Shell("WinHelp.exe vt220fwg.hlp") End Sub